package com.neusoft.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.neusoft.bean.T_menu;
import com.neusoft.service.T_menuService;

@Controller
@RequestMapping(value="/T_menu")
public class T_menuCountroller {
	
	@Autowired
	public T_menuService t_menuService;
	
	@RequestMapping(value="/addMenu")
	public ModelAndView addMenu(T_menu menu){
		ModelAndView mv = new ModelAndView("menu");
		t_menuService.addMenu(menu);
		return mv;
		
	}
	@RequestMapping(value="/deleteMenu")
	public ModelAndView deleteMenu(T_menu menu){
		ModelAndView mv = new ModelAndView("menu");
		t_menuService.deleteMenu(menu);
		return mv;
	}
	@RequestMapping(value="/updateMenu")
	public ModelAndView updateMenu(T_menu menu){
		ModelAndView mv = new ModelAndView("menu");
		t_menuService.updateMenu(menu);
		return mv;
	}
	@RequestMapping(value="/showT_menu")
	public String showT_menu(ModelMap map){
		List<T_menu> t_menuList = t_menuService.showT_menu();
		map.put("t_menuList", t_menuList);
		return "menu";
		
	}
	
}
